using FluffyUnderware.Curvy;
using System;
using UnityEngine;

public class MovablePrespawn : MonoBehaviour
{
	[Serializable]
	public class EditorReferences
	{
		public CurvySpline[] splines;

		public CurvySpline GetRandomSpline()
		{
			return splines[UnityEngine.Random.Range(0, splines.Length)];
		}
	}

	[SerializeField]
	public EditorReferences references = new EditorReferences();

	private void Start()
	{
		for (int i = 0; i < 5; i++)
		{
			MovableSplineAdapter component = GetComponent<MovableSplineAdapter>();
			component.SetInitialPosition(UnityEngine.Random.value);
			component.SetXOffset(UnityEngine.Random.Range(-5f, 5f));
			component.SetSpline(references.GetRandomSpline());
		}
	}
}
